﻿#ifndef PIPEFLUID_H
#define PIPEFLUID_H

#include <QVector>
#include <QDebug>
#include <QColor>

#include "treeNode.h"

class PipeFluid
{
public:

    struct stVertex{
        int idx;
        bool isStart;
        bool isEnd;
        bool emitting;          // 喵叽
        double emittingSpeed;
        stVertex(int idx, bool isStart, bool isEnd){
            this->idx = idx;
            this->isStart = isStart;
            this->isEnd = isEnd;
            this->emitting = false;
            this->emittingSpeed = 0;
        }
    };


    struct stPipeGrid{
        QColor color;
        double speed;
        int valveId = -1;       // <0表示没有valve
    };

    struct stEdge{
        bool connect;
        int gridNum;
        QVector<stPipeGrid> pipeGrid;
        stEdge(int gridNum){
            connect = false;
            this->gridNum = gridNum;
//            pipGr
        }
    };


    struct stValve{
        int idx;
        int v1;
        int v2;
        bool state;
        stValve(int idx, int v1, int v2){
            this->idx = idx;
            this->v1 = v1;
            this->v2 = v2;
            this->state = false;
        }
        stValve(int idx, int v1, int v2, bool state){
            this->idx = idx;
            this->v1 = v1;
            this->v2 = v2;
            this->state = state;
        }
    };


    PipeFluid();

};

#endif
